<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

</body>
<script>
    var str = /^[a-zA-Z0-9_-]{6,16}$/
    console.log(str.test('fdua47765'));
</script>
</html>